package org.naxx.security.function;

import org.naxx.security.datatype.DataType;

public final class FunctionType {
	
	private String uri;
	private Integer id;
	private boolean isGeneric;
	private String name;
	private DataType returnDataType;
	private Integer numberOfParameters;
	private DataType[] parameters;
	private String xriptlet;

	public FunctionType() {
	}

	public FunctionType(String uri) {
		this.uri = uri;
	}
	
	public void setUri(String uri) {
		this.uri = uri;
	}
	public void setIsGeneric(boolean isGeneric) {
		this.isGeneric = isGeneric;
	}
	public Integer getId() {
		return this.id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public DataType getReturnDataType() {
		return this.returnDataType;
	}
	public void setReturnDataType(DataType returnDataType) {
		this.returnDataType = returnDataType;
	}
	public Integer getNumberOfParameters() {
		return this.numberOfParameters;
	}
	public void setNumberOfParameters(Integer numberOfParameters) {
		this.numberOfParameters = numberOfParameters;
	}
	public DataType[] getParameters() {
		return this.parameters;
	}
	public void setParameters(DataType[] parameters) {
		this.parameters = parameters;
	}
	public String getXriptlet() {
		return this.xriptlet;
	}
	public void setXriptlet(String xriptlet) {
		this.xriptlet = xriptlet;
	}
	public boolean isGeneric() {
		return this.isGeneric;
	}
	public String getUri() {
		return this.uri;
	}

	public boolean equals(Object obj) {
		if (this == obj) {
		    return true;
		}
		if (obj instanceof FunctionType) {
			FunctionType rhs = (FunctionType) obj;
			return this.uri.equals(rhs.getUri()) && this.id.equals(rhs.getId());
		}
		return false;
	}

	public int hashCode() {
		return this.uri.hashCode();
	}
}
